//
//  MeCommonCell.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/7/27.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class MeCommonCell: BaseTableViewCell {
    
    @IBOutlet weak var leftImageView: UIImageView!
    
    @IBOutlet weak var leftLabel: UILabel!
    
    @IBOutlet weak var rightLabel: UILabel!
    
    var model : PersonalDataModel?
    
    var index : IndexPath!{
    
        didSet{
            
            switch index.row {
                case 1:
                    leftImageView.image = UIImage(named: "me01")
                    leftLabel.text = "我的订单"
                    rightLabel.text = "查看全部订单"
                    accessoryType = .disclosureIndicator
                case 4:
                    leftImageView.image = UIImage(named: "me10")
                    leftLabel.text = "我的鲸喜购"
                    rightLabel.text = ""
                    accessoryType = .disclosureIndicator

                case 5:
                    leftImageView.image = UIImage(named: "me11")
                    leftLabel.text = "游戏订单"
                    rightLabel.text = ""

                    accessoryType = .disclosureIndicator

                case 6:
                    leftImageView.image = UIImage(named: "me06")
                    leftLabel.text = "账户余额"
                    if model != nil{
                        
                        rightLabel.text = model!.balance + "元"
                        
                    }
                    accessoryType = .disclosureIndicator

                case 7:
                    leftImageView.image = UIImage(named: "me07")
                    leftLabel.text = "鲸币"
                    if model != nil{
                        
                        rightLabel.text = model!.gold + "个"
                        
                    }
                    accessoryType = .disclosureIndicator

                case 8:
                    leftImageView.image = UIImage(named: "me08")
                    leftLabel.text = "小鲸豆"
                    if model != nil{
                        
                        rightLabel.text = model!.bean + "个"
                        
                    }
                    accessoryType = .disclosureIndicator

                case 10:
                    leftImageView.image = UIImage(named: "me09")
                    leftLabel.text = "我的工具"
                    rightLabel.text = ""

                    accessoryType = .none

                
            default:
                
                  leftImageView.image = UIImage(named: "me06")
                  leftLabel.text = "我的订单"
                  rightLabel.text = ""


                
            }
        
        
        
        }
    
    
    
    }

    override func awakeFromNib() {
        super.awakeFromNib()
        leftLabel.textColor = UIColor.black
        rightLabel.textColor = UIColor.dakGray()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
